﻿using ATM.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ATMSystem
{
    public partial class frmModel : Form
    {
        private frmWithdraw frm1;
        private Account passedAcc;
        private Card passedCard;

        public frmModel()
        {
            InitializeComponent();
        }

        public frmModel(Account acc, Card card)
        {
            InitializeComponent();
            passedAcc = acc;
            passedCard = card;
        }

        private void btnWithdraw_Click(object sender, EventArgs e)
        {
            frm1 = new frmWithdraw(passedAcc, passedCard);
            //this.Visible = false;
            frm1.ShowDialog();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            frmReceivedID frm = new frmReceivedID(passedAcc,passedCard);
            frm.AccCusID = passedAcc.ID;
            frm.ShowDialog();
            //this.Visible=false;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            frmViewHistory frm = new frmViewHistory(passedCard);
            frm.ShowDialog();
        }

        private void btnCheckBalance_Click(object sender, EventArgs e)
        {
            frmViewBalance frm = new frmViewBalance(passedAcc,passedCard);
            frm.ShowDialog();
        }

        private void btnChanPIN_Click(object sender, EventArgs e)
        {
            frmChangePIN frm = new frmChangePIN(passedAcc,passedCard);
            frm.ShowDialog();
        }
    }
}
